/**
    ATClab - scriptable Air Traffic Control simulations.
    Copyright (C) 2010 openatclab@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/

#ifndef __ATC_SCALE_HDR__ 
#define __ATC_SCALE_HDR__

#ifdef WIN32
	#pragma warning(disable:4786) // 'identifier' truncation
#endif


#include "canvas_types.h"
#include <q3canvas.h>
#include <vector>


namespace atc{

	//
	// atc:: forward declarations
	//

	class Canvas;


	//
	// [class] atc::ScaleXHair
	//

	class ScaleXHair {

	public:
		ScaleXHair( Canvas *, int, int, int, int );
		~ScaleXHair();

	public:
		void show();
		void hide();

		void move_by( int, int );
		void move_by( const QPoint & );

	private:
		void build();
		void create_line( int, int, int, int );

	private:
		Canvas *_canvas;
		int _x, _y;
		int _xextent, _xinterval;
		int _yextent, _yinterval;
		int _ticklen;
		std::vector< Q3CanvasLine * > _xhair;

	};

	//
	// atc::ScaleLine
	//
	class ScaleLine : public Q3CanvasLine {

    public:
        ScaleLine( Q3Canvas *c, ScaleXHair *x ) 
			  : Q3CanvasLine( c ), _scale( x ) {};
        ~ScaleLine() {};

    public:
		int   rtti() const { return CanvasItem::RTTI_SCALE; }
		//QPointArray areaPoints () const;

		ScaleXHair * getXHair() { return _scale; }

	private:
		ScaleXHair *_scale;

	};


};

#endif
